<%-- 
    Document   : detailresver
    Created on : Nov 27, 2011, 11:37:15 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.ThamSoHT,Models.ThamSoHT_Model,Models.Ban_Model"%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->
<script type="text/javascript">
    function keypress(e){
        //Hàm dùng để ngăn người dùng nhập các ký tự khác ký tự số vào TextBox
        var keypressed = null;
        if (window.event)
        {
            keypressed = window.event.keyCode; //IE
        }
        else
        {
            keypressed = e.which; //NON-IE, Standard
        }
        if (keypressed < 48 || keypressed > 57 )
        { //CharCode của 0 là 48 (Theo bảng mã ASCII)
            //CharCode của 9 là 57 (Theo bảng mã ASCII)
            if (keypressed == 8 || keypressed == 127  )
            {//Phím Delete và Phím Back
                return;
            }
            return false;
        }
    }
</script>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'checkreserv', 'timehistory', 'msgdetailreserv', 'phonenumber', 'reservinfo', 'rightmsg', 'save', 'tablename', 'areaname', 'checksubmitmsg', 'hours', 'nameofcustomer', 'notice', 'numberofcustomer' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String areaname = mdsts[0].getTenTS();
            String checkreserv = mdsts[1].getTenTS();
            String checksubmitmsg = mdsts[2].getTenTS();
            String hours = mdsts[3].getTenTS();
            String msgdetailreserv = mdsts[4].getTenTS();
            String nameofcustomer = mdsts[5].getTenTS();
            String notice = mdsts[6].getTenTS();
            String numberofcustomer = mdsts[7].getTenTS();
            String phonenumber = mdsts[8].getTenTS();
            String reservinfo = mdsts[9].getTenTS();
            String rightmsg = mdsts[10].getTenTS();
            String save = mdsts[11].getTenTS();
            String tablename = mdsts[12].getTenTS();
            String timehistory = mdsts[13].getTenTS();

            String msgright = notice + "/" + rightmsg;
            String msgcheckreserv = notice + "/" + checkreserv;
            String msgchecksubmit = notice + "/" + checksubmitmsg;
            String msgdetail = notice + "/" + msgdetailreserv;

            Vector DB = (Vector) request.getAttribute("DB");
            Vector vKV = (Vector) request.getAttribute("DSKV");
            String madb = (String) request.getAttribute("madb");
            String makv = (String) request.getAttribute("makv");

%>
<script type="text/javascript">
    $(function(){
        $('#datepicker1').datepicker($.datepicker.regional['vi']);
        $( "#datepicker1" ).datepicker( "option", "dateFormat","dd/mm/yy");
        $('#datepicker2').datepicker($.datepicker.regional['vi']);
        $( "#datepicker2" ).datepicker( "option", "dateFormat","dd/mm/yy");
        $('#datepicker3').datepicker($.datepicker.regional['vi']);
        $( "#datepicker3" ).datepicker( "option", "dateFormat","dd/mm/yy");
    });
</script>

    <div class="title">
        <%=reservinfo%>
        
    </div>
    <div class="content">
        <form name="addReserv" action="">
            <%
                        for (int i = 0; i < DB.size(); i++) {
                            Beans.DatBan db = (Beans.DatBan) DB.elementAt(i);%>
            <div style=" width: 300px; float: left; margin-left: 10px;">
                <div style=" width: 100px;  float: left;"><%=areaname%></div>
                <select name="makv" style=" width: 150px;  margin-bottom: 10px;" class="1" lang="<%=msgright%>" onchange="ShowMapReserv(this.value, this.className, this.lang)">
                    <option value="<%=makv%>"><%=Ban_Model.LayTenKV(Integer.parseInt(makv), langid)%></option>
                    <%
                                        for (int k = 0; k < vKV.size(); k++) {
                                            Beans.KhuVuc kvv = (Beans.KhuVuc) vKV.elementAt(k);
                    %>
                    <option value="<%=kvv.getMaKV()%>"><%=kvv.getTenKV()%></option>
                    <%  }
                    %>
                </select>
            </div>
            <div style=" width: 150px; float: left; "><%=tablename%></div>
            <input type="textbox" class="text" value="<%=Ban_Model.LayTenBan(Integer.parseInt(makv), db.getMaBan())%>" name="tenban" style=" width: 40px; margin-bottom: 10px;" onkeypress="return keypress(event)"><br />
            <div style=" width: 300px; float: left; margin-left: 10px;">
                <div style=" width: 100px; float: left;"><%=nameofcustomer%></div>
                <input type="textbox" name="tenkh" value="<%=db.getKhachHang() %>" class="text" style="width: 150px;">
            </div>
            <div style=" width: 150px; float: left;"><%=numberofcustomer%></div>
            <input type="textbox" class="text" name="sokhach" value="<%=db.getSoKhach()%>" style=" width: 40px; margin-bottom: 10px;" onkeypress="return keypress(event)"><br />
            <div style=" width: 300px; float: left; margin-left: 10px;">
                <div style=" width: 100px;  float: left;"><%=timehistory%></div>
                <input type="textbox" class="text" name="ngay" value="<%=db.getNgay() %>" id="datepicker1" style="width: 85px; margin-right: 3px;">
                <input type="textbox" class="text" maxlength="2" name="gio" value="<%=db.getGio() %>" style="width: 30px; margin-right: 3px;" onkeypress="return keypress(event)"><%=hours%>
            </div>
            <div style=" width: 100px; float: left;"><%=phonenumber%></div>
            <input type="textbox" class="text" name="sodt" value="<%=db.getSoDT() %>" style=" width: 90px; margin-bottom: 10px;" onkeypress="return keypress(event)"><br />
            <%  }
            %>
            <input style="margin-left: 235px; margin-top: 3px; margin-bottom: 3px;" class="button" lang="<%=msgright%>" id="<%=madb %>" alt="<%=msgchecksubmit%>" name="<%=msgdetail%>" align="<%=msgcheckreserv%>"  onclick="UpdateReserv(this.id, this.lang, this.alt, this.name, this.align);"  type="button" value="<%=save%>" />

        </form>
    </div>
